home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / DHTML - Date and Time / dynamic-countup.izs < prev    next >
Text File  |  2005-08-31  |  6KB  |  174 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Dynamic Countup Script
  4. <!/TITLE>
  5.  
  6. <!BROWSER>FF1+ IE5+ Opr7+<!/BROWSER>
  7.  
  8. <!DESCRIPTION>Display how much time has passed since an expired date with this rare script. We use it below to show how long Dynamic Drive has been online.
  9. <!/DESCRIPTION> 
  10.  
  11. <!CATEGORY>date and time<!/CATEGORY>
  12.  
  13. <!SCRIPT>
  14. <!-- START OF SCR<script language="JavaScript1.2">
  15.  
  16. //Dynamic countup Script- ⌐ Dynamic Drive (www.dynamicdrive.com)
  17. //For full source code, 100's more DHTML scripts, and TOS,
  18. //visit http://www.dynamicdrive.com
  19.  
  20. function setcountup(theyear,themonth,theday){
  21. yr=theyear;mo=themonth;da=theday
  22. }
  23.  
  24. //////////CONFIGURE THE countup SCRIPT HERE//////////////////
  25.  
  26. //STEP 1: Configure the date to count up from, in the format year, month, day:
  27. //This date should be less than today
  28. setcountup(1999,3,2)
  29.  
  30. //STEP 2: Configure text to be attached to count up
  31. var displaymessage="have passed since the debut of our site!"
  32.  
  33. //STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countup area
  34. var countupwidth='95%'
  35. var countupheight='20px' //applicable only in NS4
  36. var countupbgcolor='lightyellow'
  37. var opentags='<font face="Verdana"><small>'
  38. var closetags='</small></font>'
  39.  
  40. //////////DO NOT EDIT PASS THIS LINE//////////////////
  41.  
  42. var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
  43. var crosscount=''
  44.  
  45. function start_countup(){
  46. if (document.layers)
  47. document.countupnsmain.visibility="show"
  48. else if (document.all||document.getElementById)
  49. crosscount=document.getElementById&&!document.all?document.getElementById("countupie") : countupie
  50. countup()
  51. }
  52.  
  53. if (document.all||document.getElementById)
  54. document.write('<span id="countupie" style="width:'+countupwidth+'; background-color:'+countupbgcolor+'"></span>')
  55.  
  56. window.onload=start_countup
  57.  
  58.  
  59. function countup(){
  60. var today=new Date()
  61. var todayy=today.getYear()
  62. if (todayy < 1000)
  63. todayy+=1900
  64. var todaym=today.getMonth()
  65. var todayd=today.getDate()
  66. var todayh=today.getHours()
  67. var todaymin=today.getMinutes()
  68. var todaysec=today.getSeconds()
  69. var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
  70. paststring=montharray[mo-1]+" "+da+", "+yr
  71. dd=Date.parse(todaystring)-Date.parse(paststring)
  72. dday=Math.floor(dd/(60*60*1000*24)*1)
  73. dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
  74. dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
  75. dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
  76.  
  77. if (document.layers){
  78. document.countupnsmain.document.countupnssub.document.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags)
  79. document.countupnsmain.document.countupnssub.document.close()
  80. }
  81. else if (document.all||document.getElementById)
  82. crosscount.innerHTML=opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags
  83.  
  84. setTimeout("countup()",1000)
  85. }
  86. </script>
  87.  
  88. <ilayer id="countupnsmain" width=&{countupwidth}; height=&{countupheight}; bgColor=&{countupbgcolor}; visibility=hide><layer id="countupnssub" width=&{countupwidth}; height=&{countupheight}; left=0 top=0></layer></ilayer>IPT -->
  89.  
  90. <!-- END OF SCRIPT -->
  91. <!/SCRIPT>
  92.  
  93. <!PREVIEW>
  94. <!-- START OF SCRIPT -->
  95.  
  96. <script language="JavaScript1.2">
  97.  
  98. //Dynamic countup Script- ⌐ Dynamic Drive (www.dynamicdrive.com)
  99. //For full source code, 100's more DHTML scripts, and TOS,
  100. //visit http://www.dynamicdrive.com
  101.  
  102. function setcountup(theyear,themonth,theday){
  103. yr=theyear;mo=themonth;da=theday
  104. }
  105.  
  106. //////////CONFIGURE THE countup SCRIPT HERE//////////////////
  107.  
  108. //STEP 1: Configure the date to count up from, in the format year, month, day:
  109. //This date should be less than today
  110. setcountup(1999,3,2)
  111.  
  112. //STEP 2: Configure text to be attached to count up
  113. var displaymessage="have passed since the debut of our site!"
  114.  
  115. //STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countup area
  116. var countupwidth='95%'
  117. var countupheight='20px' //applicable only in NS4
  118. var countupbgcolor='lightyellow'
  119. var opentags='<font face="Verdana"><small>'
  120. var closetags='</small></font>'
  121.  
  122. //////////DO NOT EDIT PASS THIS LINE//////////////////
  123.  
  124. var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
  125. var crosscount=''
  126.  
  127. function start_countup(){
  128. if (document.layers)
  129. document.countupnsmain.visibility="show"
  130. else if (document.all||document.getElementById)
  131. crosscount=document.getElementById&&!document.all?document.getElementById("countupie") : countupie
  132. countup()
  133. }
  134.  
  135. if (document.all||document.getElementById)
  136. document.write('<span id="countupie" style="width:'+countupwidth+'; background-color:'+countupbgcolor+'"></span>')
  137.  
  138. window.onload=start_countup
  139.  
  140.  
  141. function countup(){
  142. var today=new Date()
  143. var todayy=today.getYear()
  144. if (todayy < 1000)
  145. todayy+=1900
  146. var todaym=today.getMonth()
  147. var todayd=today.getDate()
  148. var todayh=today.getHours()
  149. var todaymin=today.getMinutes()
  150. var todaysec=today.getSeconds()
  151. var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
  152. paststring=montharray[mo-1]+" "+da+", "+yr
  153. dd=Date.parse(todaystring)-Date.parse(paststring)
  154. dday=Math.floor(dd/(60*60*1000*24)*1)
  155. dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
  156. dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
  157. dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
  158.  
  159. if (document.layers){
  160. document.countupnsmain.document.countupnssub.document.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags)
  161. document.countupnsmain.document.countupnssub.document.close()
  162. }
  163. else if (document.all||document.getElementById)
  164. crosscount.innerHTML=opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags
  165.  
  166. setTimeout("countup()",1000)
  167. }
  168. </script>
  169.  
  170. <ilayer id="countupnsmain" width=&{countupwidth}; height=&{countupheight}; bgColor=&{countupbgcolor}; visibility=hide><layer id="countupnssub" width=&{countupwidth}; height=&{countupheight}; left=0 top=0></layer></ilayer>
  171. <!-- END OF SCRIPT -->
  172. <!/PREVIEW>
  173.  
  174. <!RELATED>NONE<!/RELATED>